include ../../rules.mk


SOURCES := mds_test_xyz.c mds_test_data.c mds_test_vec.c mds_test_frame.c mds_test_md.c mds_test_crystal.c mds_test_options.c mds_test_array.c mds_test_cells.c
OBJECTS := $(call to_object,$(SOURCES))
DEPENDS := $(OBJECTS:.o=.d)

all: enter  programs leave
	@echo "====> Finished"

enter:
	@echo "==> building in $(HERE)"

leave:
	@echo "==> all done in $(HERE)"

programs : libs    \
	mds_test_xyz     \
	mds_test_data    \
	mds_test_vec     \
	mds_test_frame   \
	mds_test_md      \
	mds_test_crystal \
	mds_test_options \
	mds_test_array   \
	mds_test_cells

libs:
	@$(MAKE) -s -C ..

mds_test_xyz: $(call to_object,mds_test_xyz.c) ../../.libs/libmds.a
	$(LINK)

mds_test_data: $(call to_object,mds_test_data.c) ../../.libs/libmds.a
	$(LINK)

mds_test_vec: $(call to_object,mds_test_vec.c) ../../.libs/libmds.a
	$(LINK) 

mds_test_frame: $(call to_object,mds_test_frame.c) ../../.libs/libmds.a
	$(LINK) 

mds_test_md: $(call to_object,mds_test_md.c) ../../.libs/libmds.a
	$(LINK)
	
mds_test_crystal: $(call to_object,mds_test_crystal.c) ../../.libs/libmds.a
	$(LINK)
	
mds_test_options: $(call to_object,mds_test_options.c) ../../.libs/libmds.a
	$(LINK)

mds_test_array: $(call to_object,mds_test_array.c) ../../.libs/libmds.a
	$(LINK)
	
mds_test_cells: $(call to_object,mds_test_cells.c) ../../.libs/libmds.a
	$(LINK)
	
clean:
	$(CLEAN)
	@rm -f mds_test_xyz     mds_test_xyz.exe cube.xyz
	@rm -f mds_test_data    mds_test_data.exe
	@rm -f mds_test_vec     mds_test_vec.exe
	@rm -f mds_test_frame   mds_test_frame.exe anint.txt rbox.xyz rbox.gro
	@rm -f mds_test_md      mds_test_md.exe md.xyz info.txt
	@rm -f mds_test_crystal mds_test_crystal.exe fcc.xyz
	@rm -f mds_test_options mds_test_options.exe
	@rm -f mds_test_array   mds_test_array.exe
	@rm -f mds_test_cells   mds_test_cells.exe

rebuild:
	@$(MAKE) -s -C .. clean && $(MAKE) -s all
	
-include $(DEPENDS)

